﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using Microsoft.Practices.Prism.Events;

namespace ProjTemp.Desktop.Common.Events
{
    public enum NotifyTitleBarItemsChangedAction
    {
        Added,
        Removed,
        Replaced
    }

    public class TitleBarItem : IComparable
    {
        public TitleBarItem(string id, int viewSortHint, string title, string tooltip, string topic, Visual visual)
        {
            Id = id;
            ViewSortHint = viewSortHint;
            Title = title;
            Tooltip = tooltip;
            Topic = topic;
            Visual = visual;
        }

        public TitleBarItem(string id, int viewSortHint, string tab, string group, string title, string tooltip, string topic, Visual visual)
        {
            Id = id;
            ViewSortHint = viewSortHint;
            Tab = tab;
            Group = group;
            Title = title;
            Tooltip = tooltip;
            Topic = topic;
            Visual = visual;
        }

        public string Id { get; set; }
        public int ViewSortHint { get; set; }
        public string Title { get; set; }
        public string Tooltip { get; set; }
        public string Topic { get; set; }
        public Visual Visual { get; set; }
        public string Tab { get; set; }
        public string Group { get; set; }

        public int CompareTo(object obj)
        {
            var other = obj as TitleBarItem;
            if (other != null)
                return this.ViewSortHint - other.ViewSortHint;

            return -1;
        }
    }

    public class TitleBarItemsChanged
    {
        public NotifyTitleBarItemsChangedAction Action { get; set; }
        public List<TitleBarItem> NewTitleBarItems { get; set; }

        public TitleBarItemsChanged()
        {
            this.NewTitleBarItems = new List<TitleBarItem>();
        }
    }

    public class TitleBarItemsChangedEvent : CompositePresentationEvent<TitleBarItemsChanged>
    {
    }
}
